﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace BooksManagermentSystem
{
    public partial class AdminMain_form : Form
    {
        public AdminMain_form()
        {
            InitializeComponent();
        }

        string account;
        private void AdminMain_form_Load(object sender, EventArgs e)
        {
            account = Tag.ToString();
            if(account != "admin")
            {
                管理员管理ToolStripMenuItem.Visible= false;
            }
        }

        private void 添加图书类型ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddBookType_form abt = new AddBookType_form();
            abt.MdiParent= this;
            abt.StartPosition = FormStartPosition.CenterScreen;
            abt.Show();
        }

        private void 修改图书类型ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            UpdateBookType_form ubt = new UpdateBookType_form();
            ubt.MdiParent= this;
            ubt.StartPosition = FormStartPosition.CenterScreen;
            ubt.Show();
        }

        private void 删除图书类型ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DeleteBookType_form dbt = new DeleteBookType_form();
            dbt.MdiParent= this;
            dbt.StartPosition = FormStartPosition.CenterScreen;
            dbt.Show();
        }

        private void 学生账号注册ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddStudent_form asb = new AddStudent_form();
            asb.MdiParent = this;
            asb.StartPosition = FormStartPosition.CenterScreen;
            asb.Show();
        }

        private void 学生信息管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SelectStudentInfo_form ssi = new SelectStudentInfo_form();
            ssi.MdiParent= this;
            ssi.StartPosition = FormStartPosition.CenterScreen;
            ssi.Show();
        }

        private void 图书上架ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddBook_form ab = new AddBook_form();
            ab.MdiParent= this;
            ab.StartPosition = FormStartPosition.CenterScreen;
            ab.Show();
        }

        private void 图书下架ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DeleteBook_form db = new DeleteBook_form();
            db.MdiParent= this;
            db.StartPosition = FormStartPosition.CenterScreen;
            db.Show();
        }

        private void 添加出版社ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddPress_form ap = new AddPress_form();
            ap.MdiParent= this;
            ap.StartPosition = FormStartPosition.CenterScreen;
            ap.Show();
        }

        private void 修改出版社ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            UpdatePress_form up = new UpdatePress_form();
            up.MdiParent= this;
            up.StartPosition = FormStartPosition.CenterScreen;
            up.Show();
        }

        private void 检索图书ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            RetrieveBook_form rb = new RetrieveBook_form();
            rb.MdiParent= this;
            rb.StartPosition = FormStartPosition.CenterScreen;
            rb.Show();
        }

        private void 借阅图书ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BorrowBooks_form bb = new BorrowBooks_form();
            bb.MdiParent= this;
            bb.StartPosition = FormStartPosition.CenterScreen;
            bb.Show();
        }

        private void 归还图书ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ReturnBooks_form rb = new ReturnBooks_form();
            rb.MdiParent= this;
            rb.StartPosition = FormStartPosition.CenterScreen;
            rb.Show();
        }

        private void 缴费ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Pay_form pf = new Pay_form();
            pf.MdiParent= this;
            pf.StartPosition = FormStartPosition.CenterScreen;
            pf.Show();
        }

        private void 管理员管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AdminInfo_form ai = new AdminInfo_form();
            ai.MdiParent= this;
            ai.StartPosition = FormStartPosition.CenterScreen;
            ai.Show();
        }

        private void 个人资料ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AdminPI_form api = new AdminPI_form();
            api.MdiParent= this;
            api.StartPosition = FormStartPosition.CenterScreen;
            api.Tag = this.Tag;
            api.Show();
        }

        private void AdminMain_form_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }
    }
}
